home *** CD-ROM | disk | FTP | other *** search
/ Cocktail Hour / image.iso / COCKTAIL.DIR / objects_37_food prep script.ls < prev    next >
Encoding:
Text File  |  1997-03-05  |  6.5 KB  |  193 lines

  1. on exitFrame
  2.   global OnceCheck, Food
  3.   if OnceCheck = 0 then
  4.     cursor(-1)
  5.     set OnceCheck to 1
  6.     repeat with i = 3 to 20
  7.       if ((i > 2) and (i < 8)) or ((i > 12) and (i < 16)) or (i = 36) or (i = 37) then
  8.         set the cursor of sprite i to [34, 35]
  9.       end if
  10.     end repeat
  11.     set the cursor of sprite 7 to 0
  12.     set x to the number of lines in the text of member Food
  13.     set tarHow to line x - 3 of the text of member Food
  14.     repeat with i = 3 to 8
  15.       puppetSprite(i, 1)
  16.     end repeat
  17.     set the member of sprite 7 to member Food of castLib "small Picts"
  18.     set the member of sprite 6 to member "disabled"
  19.   end if
  20.   if not (the visible of sprite 19) and not (the visible of sprite 31) and ((Food = "food4") or (Food = "food7") or (Food = "food8")) then
  21.     set the visible of sprite 36 to 1
  22.     set the visible of sprite 37 to 1
  23.     set the visible of sprite 27 to 1
  24.     set the visible of sprite 28 to 1
  25.     set the cursor of sprite 27 to [34, 35]
  26.     set the cursor of sprite 28 to [34, 35]
  27.   else
  28.     set the visible of sprite 36 to 0
  29.     set the visible of sprite 37 to 0
  30.     set the visible of sprite 27 to 0
  31.     set the visible of sprite 28 to 0
  32.   end if
  33.   forget(window "notes")
  34.   go(the frame)
  35. end
  36.  
  37. on mouseDown
  38.   global checkPress
  39.   set checkPress to the clickOn
  40.   set bDown to the clickOn
  41.   if (bDown > 3) and (bDown < 6) then
  42.     set the member of sprite bDown to member ("PrepBtn" & bDown - 2)
  43.   else
  44.     if bDown = 3 then
  45.       set the member of sprite bDown to member "foodBtn"
  46.     else
  47.       if bDown = 6 then
  48.         if (the visible of sprite 19 = 1) or (the visible of sprite 31 = 1) then
  49.           set the member of sprite bDown to member "foodBtn2"
  50.         end if
  51.       else
  52.         if bDown = 24 then
  53.           set the member of sprite 24 to member "shopDelete" of castLib "objects"
  54.         else
  55.           if bDown = 25 then
  56.             set the member of sprite 25 to member "shopClear" of castLib "objects"
  57.           else
  58.             if bDown > 41 then
  59.               buttonPressedDown(bDown, "objects")
  60.             end if
  61.           end if
  62.         end if
  63.       end if
  64.     end if
  65.   end if
  66.   updateStage()
  67.   if ((bDown > 2) and (bDown < 7)) or (bDown = 24) or (bDown = 25) or (bDown > 41) then
  68.     repeat while the mouseDown
  69.     end repeat
  70.     set the member of sprite bDown to member "origin"
  71.   end if
  72. end
  73.  
  74. on mouseUp
  75.   global checkPress, Food, gRecNumber, goOn, Navigate, RecipeNum
  76.   set checkPress2 to the clickOn
  77.   if checkPress = checkPress2 then
  78.     set bUp to the clickOn
  79.     if (bUp > 2) and (bUp < 7) then
  80.       set the member of sprite bUp to member "Origin"
  81.       if bUp = 5 then
  82.         set the member of sprite 6 to member "origin"
  83.         repeat with i = 19 to 25
  84.           set the visible of sprite i to 0
  85.           case i of
  86.             20, 21, 23, 24, 25:
  87.               set the cursor of sprite i to 0
  88.           end case
  89.         end repeat
  90.         set the cursor of sprite 35 to [34, 35]
  91.         set the visible of sprite 34 to 0
  92.         set the visible of sprite 35 to 0
  93.         repeat with i = 31 to 32
  94.           set the visible of sprite i to 1
  95.         end repeat
  96.         set the visible of sprite 31 to 1
  97.         set the visible of sprite 32 to 1
  98.         set foodNum to value(char 5 of Food)
  99.         set goOn to 1
  100.         set RecipeNum to 174 + foodNum
  101.         set the visible of sprite 40 to 1
  102.         set the cursor of sprite 40 to [34, 35]
  103.         forget(window "notes")
  104.       else
  105.         if bUp = 4 then
  106.           set the member of sprite 6 to member "origin"
  107.           set the visible of sprite 16 to 1
  108.           repeat with i = 19 to 25
  109.             set the visible of sprite i to 1
  110.             case i of
  111.               20, 21, 23, 24, 25:
  112.                 set the cursor of sprite i to [34, 35]
  113.             end case
  114.           end repeat
  115.           set the cursor of sprite 35 to [34, 35]
  116.           set the visible of sprite 34 to 1
  117.           set the visible of sprite 35 to 1
  118.           repeat with i = 31 to 33
  119.             set the visible of sprite i to 0
  120.           end repeat
  121.           puppetSprite(24, 1)
  122.           puppetSprite(25, 1)
  123.           set the visible of sprite 16 to 1
  124.           set the visible of sprite 40 to 1
  125.           set the cursor of sprite 40 to [34, 35]
  126.         else
  127.           if bUp = 3 then
  128.             set Navigate to "food"
  129.             set dest to "entertainment"
  130.             set x to the number of lines in field "backField"
  131.             put marker(0) into line x + 1 of field "backField"
  132.             clearPuppets()
  133.             go(marker(dest))
  134.           else
  135.             if bUp = 6 then
  136.               set the member of sprite 6 to member "disabled"
  137.               updateStage()
  138.               repeat while the mouseDown
  139.               end repeat
  140.               forget(window "notes")
  141.               repeat with i = 19 to 25
  142.                 set the visible of sprite i to 0
  143.               end repeat
  144.               puppetSprite(24, 0)
  145.               puppetSprite(25, 0)
  146.               repeat with i = 31 to 35
  147.                 set the visible of sprite i to 0
  148.               end repeat
  149.               forget(window "notes")
  150.               set the visible of sprite 40 to 0
  151.               set the cursor of sprite 40 to 0
  152.             end if
  153.           end if
  154.         end if
  155.       end if
  156.     else
  157.       if bUp = 24 then
  158.         set the member of sprite 24 to member "origin"
  159.         set lastLine to the number of lines in field "shop2"
  160.         set i to 1
  161.         repeat with j = 1 to lastLine
  162.           if the foreColor of line i of field "shop2" = 35 then
  163.             delete line i of field "shop2"
  164.             delete line i of field "shop1"
  165.             next repeat
  166.           end if
  167.           set i to i + 1
  168.         end repeat
  169.         set the foreColor of field "shop1temp" to 204
  170.         set the foreColor of field "shop2temp" to 204
  171.         set the text of field "shop1temp" to line 1 to 10 of field "shop1"
  172.         set the text of field "shop2temp" to line 1 to 10 of field "shop2"
  173.       else
  174.         if bUp = 25 then
  175.           set the member of sprite 25 to member "origin"
  176.           set the foreColor of field "shop1" to 204
  177.           set the foreColor of field "shop2" to 204
  178.           set the text of field "shop1" to EMPTY
  179.           set the text of field "shop2" to EMPTY
  180.           set the foreColor of field "shop1temp" to 204
  181.           set the foreColor of field "shop2temp" to 204
  182.           set the text of field "shop1temp" to EMPTY
  183.           set the text of field "shop2temp" to EMPTY
  184.         else
  185.           if bUp > 41 then
  186.             buttonPressedUp(bUp, "objects")
  187.           end if
  188.         end if
  189.       end if
  190.     end if
  191.   end if
  192. end
  193.